package demo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import demo.dao.MissionGroupingMapper;
import demo.dao.MissionMapper;
import demo.entity.MissionGrouping;
import demo.service.MissionGroupingService;

@Service
public class MissionGroupingServiceImpl implements MissionGroupingService{

	@Resource
	private MissionGroupingMapper mgm;

	@Override
	public boolean addMissionGrouping(MissionGrouping missionGrouping) {
		// TODO Auto-generated method stub
		boolean flag=false;
		if(mgm.insertSelective(missionGrouping)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean updateMissionGrouping(MissionGrouping missionGrouping) {
		// TODO Auto-generated method stub
		boolean flag=false;
		if(mgm.updateByPrimaryKeySelective(missionGrouping)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public boolean delete(Integer id) {
		// TODO Auto-generated method stub
		boolean flag=false;
		if(mgm.deleteByPrimaryKey(id)>0) {
			flag=true;
		}
		return flag;
	}

	@Override
	public MissionGrouping getById(Integer id) {
		// TODO Auto-generated method stub
		return mgm.selectByPrimaryKey(id);
	}

	@Override
	public List<MissionGrouping> getGroupBySuperiorid(Integer id) {
		// TODO Auto-generated method stub
		return mgm.findGroupBySuperiorid(id);
	}
	
}
